﻿<Window x:Class="LiSAClient.WpfClient.View.Frame.Windows.DetachedWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:menus="clr-namespace:LiSAClient.WpfClient.View.Frame.Menus"
    xmlns:frame="clr-namespace:LiSAClient.WpfClient.View.Frame"
    xmlns:frame1="clr-namespace:LiSAClient.WpfClient.View.Frame"
    mc:Ignorable="d" 
        Title="{Binding Title}"  WindowStartupLocation="CenterScreen" Style="{StaticResource WindowStyle}"
    MinHeight="640" SizeToContent="Width"
    MinWidth="480"
    MaxHeight="{Binding MaxWindowHeight}" MaxWidth="{Binding MaxWindowWidth}"
    >
    <Grid Background="{StaticResource DetachedContentBackground}">
        <Grid.RowDefinitions>
            <RowDefinition Height="60"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Border Style="{StaticResource OtherWindowHeaderStyle}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Style="{StaticResource SmallLogoStyle}"/>

                <menus:DetachedWindowMenu DataContext="{Binding TopMenu}" Grid.Column="1" HorizontalAlignment="Right"/>
            </Grid>

        </Border>
        <DockPanel HorizontalAlignment="Stretch"  LastChildFill="True" Grid.Row="1" VerticalAlignment="Stretch">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <!--<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0" HorizontalScrollBarVisibility="Auto">-->
                    <Border BorderThickness="0" Margin="20,20,20,20">
                        <ContentControl Content="{Binding CurrentContent}" ContentTemplateSelector="{StaticResource contentDataTemplateSelector}" Focusable="False" Style="{StaticResource OtherWindowContentStyle}"/>
                    </Border>
                <!--</ScrollViewer>-->
                <frame1:WaitFrame Grid.Row="0" DataContext="{Binding Waiter}" Visibility="{Binding IsVisible, Converter={StaticResource boolToVisibilityConverter}}"/>

                <frame:MetaInfoBar DataContext="{Binding MetaInfoBar}" Grid.Row="1"/>

            </Grid>
        </DockPanel>
    </Grid>
</Window>